package com.scoutmobmap.client;

import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.scoutmobmap.shared.OfferDto;

public class OfferCell extends AbstractCell<OfferDto> {

  @Override
  public void render(Context context, OfferDto dto, SafeHtmlBuilder sb) {
    if (dto == null) { return; }

    // If the value comes from the user, we escape it to avoid XSS attacks.
   // SafeHtml safeValue = SafeHtmlUtils.fromString(value);
    sb.appendHtmlConstant("<b>");
    sb.append(s(dto.title));
    sb.appendHtmlConstant("</b>");
    sb.append(s(dto.details));
  }
  
  
  private SafeHtml s(String string) {
    return SafeHtmlUtils.fromString(string);
  }
}